package view;

import model.Task;

import javax.swing.*;
import javax.swing.border.TitledBorder;
import java.awt.*;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Student
 * Date: 30/11/12
 * Time: 09:55
 * To change this template use File | Settings | File Templates.
 */
public class ProgressPanel extends JPanel {
    public ProgressPanel(String name, Color color, List<List<Task>> taskList) {
        this(name, color, taskList, -1);
    }

    public ProgressPanel(String name, Color color, List<List<Task>> taskList, int max) {
        setLayout(new GridLayout(1, taskList.size()));
        TitledBorder border = BorderFactory.createTitledBorder(name);
        border.setTitleColor(color);
        setBorder(border);
        int progress = 1;
        for (List<Task> tl : taskList) {
            add(new ColumnPanel(Integer.toString(progress++), color, tl, max));
        }
        setBackground(Color.white);
    }
}
